package com.diandian.backend.order.controller;

import com.diandian.backend.order.param.OrderOnlineDouyinLifeDetailDetailParam;
import com.diandian.backend.order.param.OrderOnlineDouyinLifeDetailListParam;
import com.diandian.backend.order.param.OrderOnlineDouyinLifeDetailPageParam;
import com.diandian.backend.order.service.OrderOnlineDouyinLifeDetailService;
import com.diandian.base.boot.starter.response.BaseResult;
import com.diandian.base.boot.starter.util.ResultUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


/**
 * 抖音线上订单详情API
 */
@RestController
@RequestMapping("/order/online/douyin/life/detail")
public class OrderOnlineDouyinLifeDetailController{

    @Autowired
    private OrderOnlineDouyinLifeDetailService orderOnlineDouyinLifeDetailService;

    /**
    * 1. 分页查询
    */
    @PostMapping("/page")
    public BaseResult page(@RequestBody OrderOnlineDouyinLifeDetailPageParam param) {
        param.check();
        return ResultUtil.makeResult(orderOnlineDouyinLifeDetailService.page(param.toDTO()));
    }

    /**
     * 2. 查询详情
     */
    @PostMapping("/detail")
    public BaseResult getDetail(@RequestBody OrderOnlineDouyinLifeDetailDetailParam param) {
        param.check();
        return ResultUtil.makeResult(orderOnlineDouyinLifeDetailService.getDetail(param.toDTO()));
    }

    /**
     * 7. 列表查询
     */
    @PostMapping("/list")
    public BaseResult list(@RequestBody OrderOnlineDouyinLifeDetailListParam param) {
        param.check();
        return ResultUtil.makeResult(orderOnlineDouyinLifeDetailService.getList(param.toDTO()));
    }

}